package com.atguigu.interactive.threadorderaccess;

public class ThreadOrderAccess {
    public static void main(String[] args) {
        ShareData shareData = new ShareData();
        new Thread(()->{
            for (int i = 0; i < 10; i++) {
                try {
                    shareData.print5();
                } catch (InterruptedException e) {
                  e.printStackTrace();
                }
            }
        },"A").start();

        new Thread(()->{
            for (int i = 0; i < 10; i++) {
                try {
                    shareData.print10();
                } catch (InterruptedException e) {
               e.printStackTrace();
                }
            }
        },"B").start();
        new Thread(()->{

        },"B").start();

        new Thread(()->{
            for (int i = 0; i < 10; i++) {
                try {
                    shareData.print15();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"C").start();
    }
}
